//This is a cmocean colormap
//All credit to Kristen Thyng
//This colormap is under the MIT License
//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb

namespace ScottPlot.Colormaps;

public class Haline : IColormap
{
    public string Name => "Haline";
    readonly CustomPalette Colormap;
    public Color GetColor(double position) => Colormap.GetColor(position);

    public Haline()
    {
        Color[] colors =
        [
            new( 42, 24, 108 ),
            new( 42, 25, 110 ),
            new( 42, 25, 113 ),
            new( 43, 25, 115 ),
            new( 43, 25, 117 ),
            new( 44, 26, 120 ),
            new( 44, 26, 122 ),
            new( 45, 26, 125 ),
            new( 45, 26, 127 ),
            new( 45, 27, 130 ),
            new( 46, 27, 132 ),
            new( 46, 27, 135 ),
            new( 46, 28, 137 ),
            new( 46, 28, 140 ),
            new( 46, 28, 142 ),
            new( 46, 29, 145 ),
            new( 46, 29, 147 ),
            new( 46, 30, 149 ),
            new( 46, 30, 152 ),
            new( 46, 31, 154 ),
            new( 45, 32, 156 ),
            new( 45, 33, 157 ),
            new( 44, 34, 159 ),
            new( 43, 36, 160 ),
            new( 42, 37, 161 ),
            new( 41, 39, 162 ),
            new( 40, 41, 163 ),
            new( 38, 43, 163 ),
            new( 37, 45, 163 ),
            new( 36, 46, 163 ),
            new( 34, 48, 163 ),
            new( 33, 50, 162 ),
            new( 32, 52, 162 ),
            new( 30, 53, 161 ),
            new( 29, 55, 161 ),
            new( 28, 57, 160 ),
            new( 27, 58, 160 ),
            new( 25, 60, 159 ),
            new( 24, 61, 158 ),
            new( 23, 63, 158 ),
            new( 22, 64, 157 ),
            new( 21, 65, 156 ),
            new( 20, 67, 156 ),
            new( 19, 68, 155 ),
            new( 18, 69, 155 ),
            new( 17, 71, 154 ),
            new( 16, 72, 153 ),
            new( 15, 73, 153 ),
            new( 15, 74, 152 ),
            new( 14, 76, 151 ),
            new( 13, 77, 151 ),
            new( 13, 78, 150 ),
            new( 13, 79, 150 ),
            new( 12, 80, 149 ),
            new( 12, 81, 149 ),
            new( 12, 82, 148 ),
            new( 12, 83, 148 ),
            new( 12, 84, 147 ),
            new( 13, 85, 147 ),
            new( 13, 86, 146 ),
            new( 13, 87, 146 ),
            new( 14, 88, 145 ),
            new( 14, 89, 145 ),
            new( 15, 90, 145 ),
            new( 15, 91, 144 ),
            new( 16, 92, 144 ),
            new( 17, 93, 143 ),
            new( 17, 94, 143 ),
            new( 18, 95, 143 ),
            new( 19, 96, 142 ),
            new( 20, 97, 142 ),
            new( 20, 98, 142 ),
            new( 21, 99, 142 ),
            new( 22, 99, 141 ),
            new( 23, 100, 141 ),
            new( 24, 101, 141 ),
            new( 24, 102, 140 ),
            new( 25, 103, 140 ),
            new( 26, 104, 140 ),
            new( 27, 105, 140 ),
            new( 28, 106, 140 ),
            new( 29, 107, 139 ),
            new( 29, 107, 139 ),
            new( 30, 108, 139 ),
            new( 31, 109, 139 ),
            new( 32, 110, 139 ),
            new( 33, 111, 139 ),
            new( 34, 112, 138 ),
            new( 34, 113, 138 ),
            new( 35, 113, 138 ),
            new( 36, 114, 138 ),
            new( 37, 115, 138 ),
            new( 38, 116, 138 ),
            new( 38, 117, 138 ),
            new( 39, 118, 138 ),
            new( 40, 118, 137 ),
            new( 41, 119, 137 ),
            new( 41, 120, 137 ),
            new( 42, 121, 137 ),
            new( 43, 122, 137 ),
            new( 43, 123, 137 ),
            new( 44, 124, 137 ),
            new( 45, 124, 137 ),
            new( 45, 125, 137 ),
            new( 46, 126, 137 ),
            new( 47, 127, 137 ),
            new( 47, 128, 137 ),
            new( 48, 129, 137 ),
            new( 49, 130, 137 ),
            new( 49, 130, 136 ),
            new( 50, 131, 136 ),
            new( 51, 132, 136 ),
            new( 51, 133, 136 ),
            new( 52, 134, 136 ),
            new( 52, 135, 136 ),
            new( 53, 136, 136 ),
            new( 53, 137, 136 ),
            new( 54, 137, 136 ),
            new( 55, 138, 136 ),
            new( 55, 139, 136 ),
            new( 56, 140, 136 ),
            new( 56, 141, 136 ),
            new( 57, 142, 136 ),
            new( 57, 143, 136 ),
            new( 58, 144, 135 ),
            new( 58, 144, 135 ),
            new( 59, 145, 135 ),
            new( 59, 146, 135 ),
            new( 60, 147, 135 ),
            new( 60, 148, 135 ),
            new( 61, 149, 135 ),
            new( 61, 150, 135 ),
            new( 62, 151, 135 ),
            new( 62, 152, 134 ),
            new( 63, 153, 134 ),
            new( 63, 153, 134 ),
            new( 64, 154, 134 ),
            new( 65, 155, 134 ),
            new( 65, 156, 133 ),
            new( 66, 157, 133 ),
            new( 66, 158, 133 ),
            new( 67, 159, 133 ),
            new( 67, 160, 132 ),
            new( 68, 161, 132 ),
            new( 68, 162, 132 ),
            new( 69, 163, 132 ),
            new( 70, 164, 131 ),
            new( 70, 164, 131 ),
            new( 71, 165, 131 ),
            new( 72, 166, 130 ),
            new( 72, 167, 130 ),
            new( 73, 168, 130 ),
            new( 74, 169, 129 ),
            new( 74, 170, 129 ),
            new( 75, 171, 129 ),
            new( 76, 172, 128 ),
            new( 76, 173, 128 ),
            new( 77, 174, 127 ),
            new( 78, 174, 127 ),
            new( 79, 175, 126 ),
            new( 80, 176, 126 ),
            new( 81, 177, 125 ),
            new( 81, 178, 125 ),
            new( 82, 179, 124 ),
            new( 83, 180, 124 ),
            new( 84, 181, 123 ),
            new( 85, 182, 123 ),
            new( 86, 183, 122 ),
            new( 87, 184, 121 ),
            new( 88, 184, 121 ),
            new( 90, 185, 120 ),
            new( 91, 186, 119 ),
            new( 92, 187, 119 ),
            new( 93, 188, 118 ),
            new( 94, 189, 117 ),
            new( 95, 190, 117 ),
            new( 97, 191, 116 ),
            new( 98, 191, 115 ),
            new( 99, 192, 114 ),
            new( 101, 193, 114 ),
            new( 102, 194, 113 ),
            new( 104, 195, 112 ),
            new( 105, 196, 111 ),
            new( 107, 196, 110 ),
            new( 108, 197, 110 ),
            new( 110, 198, 109 ),
            new( 112, 199, 108 ),
            new( 113, 200, 107 ),
            new( 115, 200, 106 ),
            new( 117, 201, 105 ),
            new( 119, 202, 104 ),
            new( 120, 203, 104 ),
            new( 122, 203, 103 ),
            new( 124, 204, 102 ),
            new( 126, 205, 101 ),
            new( 128, 206, 100 ),
            new( 130, 206, 99 ),
            new( 132, 207, 98 ),
            new( 134, 208, 98 ),
            new( 137, 208, 97 ),
            new( 139, 209, 96 ),
            new( 141, 210, 95 ),
            new( 143, 210, 95 ),
            new( 146, 211, 94 ),
            new( 148, 211, 93 ),
            new( 151, 212, 93 ),
            new( 153, 212, 93 ),
            new( 155, 213, 92 ),
            new( 158, 214, 92 ),
            new( 160, 214, 92 ),
            new( 163, 215, 92 ),
            new( 165, 215, 92 ),
            new( 168, 216, 92 ),
            new( 170, 216, 92 ),
            new( 173, 216, 92 ),
            new( 175, 217, 93 ),
            new( 177, 217, 93 ),
            new( 180, 218, 94 ),
            new( 182, 218, 95 ),
            new( 184, 219, 96 ),
            new( 187, 219, 97 ),
            new( 189, 220, 98 ),
            new( 191, 220, 99 ),
            new( 193, 221, 100 ),
            new( 196, 221, 101 ),
            new( 198, 222, 102 ),
            new( 200, 222, 103 ),
            new( 202, 223, 105 ),
            new( 204, 223, 106 ),
            new( 206, 224, 108 ),
            new( 208, 224, 109 ),
            new( 210, 225, 111 ),
            new( 212, 225, 112 ),
            new( 214, 226, 114 ),
            new( 216, 226, 115 ),
            new( 218, 227, 117 ),
            new( 220, 227, 119 ),
            new( 222, 228, 121 ),
            new( 224, 229, 122 ),
            new( 225, 229, 124 ),
            new( 227, 230, 126 ),
            new( 229, 230, 128 ),
            new( 231, 231, 129 ),
            new( 233, 231, 131 ),
            new( 235, 232, 133 ),
            new( 236, 233, 135 ),
            new( 238, 233, 137 ),
            new( 240, 234, 138 ),
            new( 242, 234, 140 ),
            new( 243, 235, 142 ),
            new( 245, 236, 144 ),
            new( 247, 236, 146 ),
            new( 248, 237, 148 ),
            new( 250, 238, 150 ),
            new( 252, 238, 152 ),
            new( 253, 239, 154 ),
        ];

        Colormap = new CustomPalette(colors);
    }
}

